<?php
/*
 Plugin Name: WP User Data
 Version: 1.0
 Plugin URI: http://blog.suaboaforma.com/wp/wp-user-data/
 Author: Achylles Moreira (AZM)
 Author URI: http://blog.suaboaforma.com
 Description: Enabling WP User Data modules you can integrate your WordPress subscribers database with plugin users database. The e-mail user will be the reference and any data imported or update will be available to any blog application using the 'user_meta' feature WordPress. Allows geolocation by IP, importing and exporting data, mail merge for mailing lists, sending birthday messages and many other features.
 License: GPL3
 */

/*
 Copyright 2008-2010 Achylles Moreira (email : achylles.moreira@gmail.com)

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

load_plugin_textdomain("wpud", false, dirname( plugin_basename(__FILE__) ) . "/languages");

function _wpud_init_method()
{
  include rtrim(dirname(__FILE__), "/")."/functions.php";
  //
  wp_register_script("_wpud_js", rtrim(WP_PLUGIN_URL, "/")."/wp-user-data/functions.js");
  wp_enqueue_script("_wpud_js");
  //
  $plugin_ids = _wpud_get_plugins();
  foreach ($plugin_ids as $plugin_id)
  {
    if ( _wpud_check($plugin_id) == true and get_option("_wpud_".$plugin_id) == "on" )
    { add_action("admin_init", call_user_func("_wpud_register_script", $plugin_id));}
  }
}

add_action("admin_init", "_wpud_init_method");

?>
